cmake_minimum_required(VERSION 2.8)
project(NanoPlugin)
set(ORTHANC_FRAMEWORK_VERSION "mainline")
set(ORTHANC_FRAMEWORK_SOURCE "path" CACHE STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\" or \"path\")")
set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
set(ORTHANC_OPTIMAL_VERSION_MAJOR    1)
set(ORTHANC_OPTIMAL_VERSION_MINOR    12)
set(ORTHANC_OPTIMAL_VERSION_REVISION 0)
set(ORTHANC_SDK_DEFAULT_VERSION "1.12.4")
set(ORTHANC_FRAMEWORK_ROOT ${CMAKE_SOURCE_DIR}/Sources)
set(ALLOW_DOWNLOADS ON)
set(ORTHANC_FRAMEWORK_PLUGIN ON)

include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkParameters.cmake)

set(ENABLE_LOCALE ON)
set(ENABLE_MODULE_IMAGES OFF CACHE INTERNAL "Enable module for image processing")
set(ENABLE_MODULE_JOBS OFF CACHE INTERNAL "Enable module for jobs")
set(ENABLE_MODULE_DICOM OFF CACHE INTERNAL "Enable module for DICOM handling")

include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkConfiguration.cmake)

include_directories(
    ${CMAKE_SOURCE_DIR}
    ${ORTHANC_FRAMEWORK_ROOT}
    ${CMAKE_SOURCE_DIR}/Plugins/Engine
    ${CMAKE_SOURCE_DIR}/Plugins/Include
    ${CMAKE_SOURCE_DIR}/Plugins/Samples/Common
)

EmbedResources(
        ORTHANC_EXPLORER  ${CMAKE_SOURCE_DIR}/Resources/OrthancExplorer.js
)

add_definitions(
  -DHAS_ORTHANC_EXCEPTION=1
  -DORTHANC_ENABLE_LOGGING_PLUGIN=1
)

set(CORE_SOURCES
  ${CMAKE_SOURCE_DIR}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
  ${ORTHANC_CORE_SOURCES}
)

add_library(MiniPlugin SHARED
  ${CORE_SOURCES}
  ${CMAKE_SOURCE_DIR}/MiniPlugin.cpp
  ${CMAKE_SOURCE_DIR}/ScaleImage.cpp
  ${AUTOGENERATED_SOURCES}
)
